package ch03.Shili.test;

import ch03.Shili.dao.NewsDao;
import ch03.Shili.factory.AbstractFactory;
import ch03.Shili.factory.MySqlDaoFactory;
import ch03.Shili.service.impl.NewsServiceImpl;

public class Shili5 {
    public static void main(String[] args) {
        AbstractFactory factory = new MySqlDaoFactory();//改变具体工厂可创建不同产品
        NewsDao dao = factory.getInstance();
        NewsServiceImpl service = new NewsServiceImpl();
        service.setDao(dao);
    }
}
